// 本文件专门用来发跟频道相关的请求
import instance from '../utils/request'

// 封装一个专门用来获取频道的接口
export const getChannels = () => {

  return instance({
    url: '/v1_0/user/channels',
    method: 'get'
  })
}


// 封装一个专门用来获取所有频道的接口
export const getAllChannels = () => {

  return instance({
    url: '/v1_0/channels',
    method: 'get'
  })
}


// 封装一个专门用来添加频道的接口
export const addChannel = ( channels ) => {

  return instance({

    url: '/v1_0/user/channels',
    method: 'PATCH',
    data: {
      channels
    }
  })
}


// 封装一个专门用来删除频道的接口
export const removeChannel = ( channels ) => {

  return instance({

    url: '/v1_0/user/channels',
    method: 'DELETE',
    data: {
      channels
    }
  })
}